<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-menu
          :router="true"
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <!-- <el-sub-menu index="4">
            <template #title>
              <span>管理系统</span>
            </template>
            <el-menu-item index="/Admin/Login">管理系统登录</el-menu-item>
          </el-sub-menu> -->
          <el-sub-menu index="1">
            <template #title>
              <span>商品</span>
            </template>

            <el-menu-item index="/Admin/list1">商品列表</el-menu-item>
            <el-menu-item index="/Admin/add1">筛选商品</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="2">
            <template #title>
              <span>轮播图</span>
            </template>

            <el-menu-item
              ><router-link to="/Admin/list"
                >轮播图列表</router-link
              ></el-menu-item
            >
            <el-menu-item
              ><router-link to="/Admin/add"
                >添加轮播图</router-link
              ></el-menu-item
            >
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <span>管理员信息</span>
            </template>

            <el-menu-item index="/Admin/list2">管理员列表</el-menu-item>
            <el-menu-item index="/Admin/add2">添加管理员</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <span>地址</span>
            </template>
            <el-menu-item index="/Admin/list3">获取地址列表</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="5">
            <template #title>
              <span>订单</span>
            </template>
            <el-menu-item index="/Admin/list4">查看全部订单列表</el-menu-item>
            <el-menu-item index="/Admin/sxorder">查看各种状态订单列表</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="6">
            <template #title>
              <span>图表数据</span>
            </template>
            <el-menu-item index="/Admin/simple">简单K线图</el-menu-item>
            <el-menu-item index="/Admin/simpledata">简单图表数据</el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header>嗨购后台管理系统</el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from "@element-plus/icons-vue";
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
</script>

<style scoped>
.common-layout {
  width: 100%;
  height: 100%;
}
.el-container {
  width: 100%;
  height: 100%;
}
.el-aside {
  width: 200px;
  height: 100%;
  background-color: #fff;
}
.el-header {
  width: 100%;
  height: 100px;
  background-color: rgb(32, 173, 229);
  text-align: center;
  line-height: 100px;
  letter-spacing: 5px;
}
.el-main {
  width: 100%;
  height: 1000px;
  background-color: #fff;
}
</style>